<div class="archives-list">
  <div class="archives-list-title">
     <span>
       责任清单制定
     </span>
  </div>
  <div class="archives-list-header">
    <div class="p-col" style="width: 100%">
      <div class="p-4 pull-left">
<!--        <input type="text" style="border: 1px #B3B3B3 solid" pInputText placeholder="请选择组织" (click)="this.treeDialog = true; "/>-->
<!--        <input pInputText type="text" placeholder="请输入岗位" style="margin-left: 20px; border: none; border: 1px #B3B3B3 solid"/>-->
      </div>
      <div class="p-4 pull-right">
        <button pButton type="button" label="删除" class="ui-button-rounded" (click)="delete();"></button>
        <button pButton type="button" label="新增" class="ui-button-rounded" (click)="clearData(); showDialog = true;"></button>
      </div>
    </div>
    <!--    <div class="archives-list-button">-->
    <!--      <button pButton type="button" label="添加权限" class="ui-button-rounded" (click)="showAddarchivesListClick()"></button>-->
    <!--      <button pButton type="button" label="批量删除" class="ui-button-rounded" (click)="delarchivesListInfoClick()"></button>-->
    <!--    </div>-->
  </div>
  <div class="archives-list-table">
    <app-check-table-btn [select]="archivesListSelect"  (selectData)="selectData($event)" [option]="optionTable"
                      (detail)="DetailClick($event)"></app-check-table-btn>
  </div>
  <div class="archives-list-pagination">
    <app-pagination [option]="pageOption" (clickEvent)="clickEvent($event)"></app-pagination>
  </div>


  <p-dialog header="新增责任清单" [(visible)]="showDialog" [style]="{width: '900px', color: '#333'}" >
    <p-scrollPanel [style]="{width: '100%', height: '400px'}">
      <div class="body" style="padding-bottom: 30px">
        <div class="row" style="line-height: 35px;">
          <div class="ui-g-9">
            <div class="ui-g-6 ui-inputgroup text-center">
              <label>请选择组织：</label>
              <input type="text" [value]="(dataTree ? dataTree.label : '' )" pInputText placeholder="请选择组织" (click)="this.treeDialog = true"/>
            </div>
            <div class="ui-g-6 ui-inputgroup">
              <label>设置责任岗位：</label>
              <input pInputText [(ngModel)]="position" type="text" placeholder="请输入岗位" style="margin-left: 20px"/>
            </div>
          </div>
          <div class="ui-g-3 add">
            <button style="font-size: 12px; padding: 0 14px" pButton type="button" label="新增一项检查" icon="fa fa-plus"
                    class="ui-button-rounded" (click)="add()"></button>
          </div>
        </div>
        <div style="clear: both"></div>
        <div class="row" style="background-color: rgb(209, 224, 247); height: 50px; line-height: 38px">
          <div>
            <div class="ui-g-8 ui-g-offset-2 text-center">
              <input pInputText type="text" [(ngModel)]="listName" placeholder="点击输入检查清单名称" style="width: 100%"/>
            </div>
            <div class="ui-g-2">
              <span>总分：{{totalFraction}}</span>
            </div>
          </div>
        </div>
        <div style="clear: both"></div>
        <div>
          <div class="forms">
            <form *ngFor="let form of contentForms; let i = index" [formGroup]="form" style="line-height: 60px">
              <div class="ui-g ui-fluid">
                <div class="ui-g-1 text-center">
                  <span>{{i + 1}}</span>
                </div>
                <div class="ui-g-8 center">
                  <input style="height: 60px" pInputText type="text" formControlName="content" placeholder="点击输入检查内容"/>
                </div>
                <div class="ui-g-2 text-center">
                  <input style="height: 60px; width: 100px" (change)="getFraction($event)" [(ngModel)]="scores[i]" pInputText type="text" formControlName="fraction" placeholder="输入分数"/>
                </div>
                <div class="ui-g-1">
                  <button style="font-size: 12px; background-color: #d77373" pButton type="button" label="删除"
                          class="ui-button-rounded" (click)="remove(form)"></button>
                </div>
              </div>
              <div style="clear: both"></div>
            </form>
          </div>
        </div>
      </div>
    </p-scrollPanel>
    <p-footer>
      <button pButton type="button" label="保存" class="ui-button-rounded" (click)="save(dataTree)"></button>
    </p-footer>
  </p-dialog>
  <!--组织树结构-->
  <p-dialog [(visible)]="treeDialog" [responsive]="true" showEffect="fade" [modal]=false [maximizable]="false"
            [baseZIndex]="10000" [modal]="true" [width]="350" [height]="400">
    <div class="ui-g ui-fluid">
      <div class="ui-g-12">
        <p-scrollPanel [style]="{width: '100%', height: '250px'}">
          <p-tree
            [value]="dataTrees"
            [(selection)]="dataTree"
            selectionMode="single">
          </p-tree>
        </p-scrollPanel>
      </div>
    </div>
    <p-footer>
      <button style="width: 4vw;padding: 4px 0" (click)="treeDialog = false">取消</button>
      <button style="width: 6vw;border: 0;color: #fff;padding: 4px 0" (click)="dataTreeSureClick()">确认选择</button>
    </p-footer>
  </p-dialog>
</div>

